/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Simple dialog to be used
 */

#ifndef DIALOG_H
#define DIALOG_H

#include "cocos2d.h"
#include <vector>

class Dialog : public cocos2d::CCLayer {
public:
	// default constructor
	Dialog( std::string dialogTitle, float titleSize = 1.0f );
	// default destructor
	~Dialog();

	// default update function
	void update( cocos2d::ccTime dt );

	// add more text to dialog
	cocos2d::CCLabelBMFont* addText( std::string text, float x, float y ); 
	// add a button with a text on top to the dialog
	void addTextButton( CCObject* target, cocos2d::SEL_MenuHandler selector, std::string text, float x, float y, cocos2d::CCSize scale );
	// add a sprite to the dialog
	void addSprite( char *sprite, float x, float y, cocos2d::CCSize scale );

	// show dialog with a wanted time
	void showDialogFadeIn( float fadeTime = 1.5f );
	// hide dialog with a wanted time
	void hideDialogFadeOut( float fadeTime = 1.5f );

private:
	// dialog menu
	cocos2d::CCMenu *mMenu;

	// fade time & time left
	float mTotalFadeTime;
	float mFadeTimeCounter;

	// sprites added
	std::vector< cocos2d::CCSprite* > mSprites;
};

#endif